﻿using Mido.Utils.Mvvm;
using System;
using System.Windows.Media.Imaging;

namespace Mido.Domain
{
	public class ProcessedSmallImageViewModel : ViewModelBase
	{
		private readonly ProcessedImage _image;

		public ProcessedSmallImageViewModel(ProcessedImage image)
		{
			if (image == null) 
				throw new ArgumentNullException("image");

			_image = image;
			_image.SmallImageChanged += OnSmallImageChanged;
		}
		
		private void OnSmallImageChanged()
		{
			RaisePropertyChanged("SmallImage");
		}

		public ProcessedImage Source
		{
			get { return _image; }
		}

		public BitmapSource SmallImage
		{
			get { return _image.SmallImage; }
		}

		public string ToolTipText
		{
			get { return _image.ToolTipText; }
		}

		public SimpleCommand ExcludeCommand
		{
			get { return new SimpleCommand(_image.OnExcludeCall); }
		}
	}
}
